#include "msg_handle.h"

void msg_handler()
{
    msg_node_t* head = msg_get_head();
    message_t *msg;
    do{
        head =  head->next;
        head->msg->handler();
    }while(head->msg_type != MSG_HEAD);
}


static void msg_manager_loop(void *pvParameters)
{
    while (1)
    {
        //printf("msg handler");
       // msg_handler();
        //weather_get_data();
        vTaskDelay(10 / portTICK_PERIOD_MS);
    }
}


void msg_manager_init(void)
{
    msg_manager__create();
    //weather_msg_init();
    
    xTaskCreate(msg_manager_loop, "msg_manager", 4096 * 3, NULL, 7, NULL);
}
